//
//  inputMixer.h
//  Wi-Fi Party remade-1
//
//  Created by Vieta Ken on 2021/4/16.
//

#import <Foundation/Foundation.h>
#import <netinet/in.h>
#import <arpa/inet.h>
#import <sys/socket.h>
#import "config.h"
#import "Functions.h"
#import "Queue.h"
#import "Protocol.h"
#import "partyPacket.h"

#define PROTOCOL_VERSION 1

NS_ASSUME_NONNULL_BEGIN

@interface inputMixer : NSObject{
    NSMutableDictionary *tracks;
    Queue *result;
    struct sockaddr_in send_addr;
    int send_socket;
    bool mixing;
    dispatch_queue_t dispatch_queue;
    @public int length;
};
-(id)init;
-(void)addAudioSegment: (const signed char*)buffer ofSize:(int)size from:(id)sender;
-(void)setTrack: (Queue *)track from:(id)sender;
-(void)flush;
-(void)dealloc;
@end

NS_ASSUME_NONNULL_END
